<?php
require_once 'config.php';
define("ERROR_SESSION_CODE", 10000);
class ErrorManager
{ 
	static function sessionError()
	{
		$serviceError = new VOServiceError();
		$serviceError->error = TRUE;
		$serviceError->errorCode = ERROR_SESSION_CODE;
		$serviceError->errorString = "Invalid Session";
		$serviceError->errorDesc = "User session has been expired, Please login again";
		return $serviceError;
	}
	
	static function sqlError(mysqli $mysqli, $query)
	{
		$sqlError = new VOSqlError();
		
		$sqlError->error = TRUE;
		$sqlError->errorDesc = $mysqli->error;
		if(SERVICE_SHOW_SQL){
			$sqlError->sql = $query;
		}
		return $sqlError;
	}
}
?>